<?php
/*
// Create connection
$con = mysqli_connect("localhost","root","","mysql");

// Check connection
if (mysqli_connect_errno($con))
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

echo "connection established";
echo "<br>";
echo date("Y-m-d H:i:s");  
echo "<br>";
$result = mysqli_query($con, "SELECT * FROM page_comment");


while($row = mysqli_fetch_array($result))
{
$timestamp = strtotime($row['publishTime']);
echo $row['publisher']."\t".$row['comment']."\t".date("Y-m-d H:i:s", $timestamp);
echo "<br>";
}

mysqli_close($con);*/
 
$comment = "Hi";
$publisher = "abc";
$date = date("Y-m-d H:i:s");


$con = mysqli_connect("localhost","root","","mysql");

// Check connection
if (mysqli_connect_errno($con))
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }

mysqli_query($con, "INSERT INTO page_comment (publisher, comment,pageID) VALUES ('$publisher','$comment','start')");
echo "New Record has id "+mysqli_insert_id($con);

mysqli_close($con);

echo "<tr><td>$comment</td><td>$publisher</td><td>$date</td></tr>";
 
?> 

